package com.tmpt.controller.action;


import com.opensymphony.xwork2.ActionSupport;
import com.tmpt.dto.A1OperationlogDto;
import com.tmpt.dto.Result;
import com.tmpt.service.ILayoutUIService;
import com.tmpt.service.ITemplateService;
import com.tmpt.utils.WebUtils;
import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
 *
 <package name="back_layoutui_ajax" namespace="/admin123/layoutUI/" extends="json-default" strict-method-invocation="false">
 <action name="layoutUIAjax_*" class="layoutUIAction" method="{1}">
 <result name="jsonResult" type="json">
 <param name="root">result</param>
 </result>
 </action>
 </package>
 */
@Controller
@Scope("prototype")
public class LayoutUIAction extends ActionSupport{
	private Logger log = Logger.getLogger(this.getClass());
	

	//添加编辑数据时，做定向
	private String uiStyle;
	private String layoutStyle;
	private String isdialog4AddDialog;
	private String keyRandom;

	
	private String result;	
	private List<Map<String,Object>> jsonArrayResult = new ArrayList<Map<String,Object>>();
	A1OperationlogDto oprDtoBack = new A1OperationlogDto(WebUtils.getRequest(), A1OperationlogDto.UserTypeBack);
	
	@Resource
	ILayoutUIService layoutUIService;

	

	public String saveStyle(){
		Result resultObj = layoutUIService.saveStyle(keyRandom, uiStyle, layoutStyle,isdialog4AddDialog);
		this.result = ""+resultObj.isSuccess();
		return "jsonResult";
	}




	public String getUiStyle() {
		return uiStyle;
	}

	public void setUiStyle(String uiStyle) {
		this.uiStyle = uiStyle;
	}

	public String getLayoutStyle() {
		return layoutStyle;
	}

	public void setLayoutStyle(String layoutStyle) {
		this.layoutStyle = layoutStyle;
	}

	public String getKeyRandom() {
		return keyRandom;
	}

	public void setKeyRandom(String keyRandom) {
		this.keyRandom = keyRandom;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public List<Map<String, Object>> getJsonArrayResult() {
		return jsonArrayResult;
	}

	public void setJsonArrayResult(List<Map<String, Object>> jsonArrayResult) {
		this.jsonArrayResult = jsonArrayResult;
	}

	public String getIsdialog4AddDialog() {
		return isdialog4AddDialog;
	}

	public void setIsdialog4AddDialog(String isdialog4AddDialog) {
		this.isdialog4AddDialog = isdialog4AddDialog;
	}
}
